package org.net5ijy.commons.util;

import java.io.IOException;
import java.util.Properties;
import lombok.extern.slf4j.Slf4j;

/**
 * PropertiesHolder类
 *
 * @author xuguofeng
 * @date 2020/7/13 11:21
 */
@Slf4j
public class PropertiesHolder {

  private Properties prop = new Properties();

  public PropertiesHolder(String propertiesName) {
    try {
      prop.load(IoUtils.resourceInputStream(propertiesName));
    } catch (IOException e) {
      log.error(e.getMessage(), e);
    }
  }

  public String getProperty(String key) {
    return prop.getProperty(key);
  }
}
